﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EasySite.Models;
using EasySite.Services;

namespace EasySite.Web.Caches
{
    public class MenuCache
    {
        private List<MenuItem> _menuItems;
        public List<MenuItem> MenuItems
        {
            get { return _menuItems; }
        }

        public void Reload()
        {
            var service = DependencyResolver.Current.GetService<IMenuService>();
            _menuItems = service.GetMenuItems();
        }

        public MenuCache()
        {
            this.Reload();
        }
    }
}